import Vue from "vue";
import VueRouter from "vue-router";
// import HomeView from "../views/HomeView.vue";
import Login from "../components/login/Login";
import Home from '../components/home/home';
import Head from "../components/home/page/Head";
import List from "../components/user/UserList";
import Good from "../components/shopAdmin/good";
import Goodlist from "../components/shopAdmin/goodList";
import faker from "../components/shopAdmin/Faker";
import Fakerlist from "../components/shopAdmin/Fakerlist";
import Word from "../components/Word/Word";
import Look from "../components/Word/WordLook";
import goodAdd from "../components/shopAdmin/goodAdd";
import goodmove from "../components/shopAdmin/goodmove";
import FakerAdd from "../components/shopAdmin/FakerAdd";

Vue.use(VueRouter);

const routes = [
	{
		path: '/',
		name: 'home',
		component: Home,
		meta: {
			requireAuth: true,
			title: "系统首页"
		},
		redirect:'/head',
		children:[
			{
				path: 'head',
				name: 'head',
				component: Head,
				meta:{
					requireAuth:true,
					title:"系统首页/主体部分"
				},
			},
			{
				path: 'List',
				name: 'List',
				component: List,
				meta:{
					requireAuth:true,
					title:"用户列表"
				},
			},
			{
				path: 'Good',
				name: 'Good',
				component: Good,
				meta:{
					requireAuth:true,
					title:"商品管理"
				},
			},
			{
				path: 'faker',
				name: 'faker',
				component: faker,
				meta:{
					requireAuth:true,
					title:"品类管理"
				},
			},
			{
				path: 'Fakerlist',
				name: 'Fakerlist',
				component: Fakerlist,
				meta:{
					requireAuth:true,
					title:"品类管理"
				},
			},
			{
				path: 'FakerAdd',
				name: 'FakerAdd',
				component: FakerAdd,
				meta:{
					requireAuth:true,
					title:"品类添加"
				},
			},
			{
				path: 'Word',
				name: 'Word',
				component: Word,
				meta:{
					requireAuth:true,
					title:"订单管理"
				},
			},
			{
				path: 'Look',
				name: 'Look',
				component: Look,
				meta:{
					requireAuth:true,
					title:"订单详情"
				},
			},
			{
				path: 'Goodlist',
				name: 'Goodlist',
				component: Goodlist,
				meta:{
					requireAuth:true,
					title:"商品详情"
				},
			},
			{
				path: 'goodadd',
				name: 'goodadd',
				component: goodAdd,
				meta:{
					requireAuth:true,
					title:"商品添加"
				},
			},
			{
				path: 'goodmove',
				name: 'goodmove',
				component: goodmove,
				meta:{
					requireAuth:true,
					title:"商品编辑"
				},
			},
		]
	},
	{
		path: '/login',
		name: 'login',
		component: Login,
		meta:{title:"登录系统"}
	},
];

const router = new VueRouter({
  routes,
});

export default router;
